package com.gasq.community.message.kafka.basemessageentity;

/**
 * Created by mjh on 2017/1/6.
 */
public class MessageEntity<T> {

    private  String dateType = null; //用于标记实体的数据类型

    private MessageAction messageAction; //消息的操作类型

    private T data;

    /**
     * 发送消息的包装实体 构造
     * @param dateType
     * @param messageAction
     * @param data
     */
    public MessageEntity(String dateType, MessageAction messageAction, T data) {
        this.dateType = dateType;
        this.messageAction = messageAction;
        this.data = data;
    }

    public MessageEntity() {
    }

    public String getDateType() {
        return dateType;
    }

    public void setDateType(String dateType) {
        this.dateType = dateType;
    }

    public MessageAction getMessageAction() {
        return messageAction;
    }

    public void setMessageAction(MessageAction messageAction) {
        this.messageAction = messageAction;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return "MessageEntity{" +
                "dateType='" + dateType + '\'' +
                ", messageAction=" + messageAction +
                ", data=" + data +
                '}';
    }
}
